<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>vue 键盘事件</title>
</head>
<body>
<div id="app">

    <form action="">
        <label for="content">请输入内容
            <!--按键修饰符就是对指定的按键进行处理-->
            <input type="text" name="content" id="content" v-on:keypress.shift="keypressed">
        </label>
    </form>


</div>

<script type="module">
    import {createApp} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {

                function keypressed(event) {

                    let element = document.querySelector("#content");
                    console.log(element.value);

                }


                return {
                    keypressed,

                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>